package study.mybatis.database.cpool.controller;

import cn.hutool.core.thread.ThreadUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import study.eggs.result.Result;
import study.eggs.result.Results;
import study.mybatis.database.cpool.mapper.UserBaseEO;
import study.mybatis.database.cpool.mapper.UserBaseMapper;

@Slf4j
@RestController
public class ConnectionController {

    @Autowired
    private UserBaseMapper userBaseMapper;

    @RequestMapping("/connection")
    public Result echo() {
        UserBaseEO ubEO = userBaseMapper.get(1l);
        ThreadUtil.sleep(1000);
        return Results.ok(ubEO);
    }
}
